﻿using System;
using DAL.Abstract;
using DAL.Class;

namespace DAL.Strategies
{
    public class FileLoadStrategy : IFileLoadStrategy
    {
        public IFileLoad FileLoad { get; set; }

        public int Execute(LoadFileAction fileAction, string path, string separator)
        {
            switch (fileAction)
            {
                case LoadFileAction.MARA:
                    {
                        FileLoad = new MaraFileLoad();
                        return FileLoad.LoadCsvDataIntoSqlServer(path, separator);
                    }
                case LoadFileAction.MBEW:
                    {
                        FileLoad = new MbewFileLoad();
                        return FileLoad.LoadCsvDataIntoSqlServer(path, separator);
                    }
                case LoadFileAction.MARD:
                    {
                        FileLoad = new MardFileLoad();
                        return FileLoad.LoadCsvDataIntoSqlServer(path, separator);
                    }
                case LoadFileAction.MARC:
                    {
                        return 0;
                        break;
                    }
                case LoadFileAction.LABELS:
                {
                    FileLoad = new LabelFileLoad();
                    return FileLoad.LoadCsvDataIntoSqlServer(path, separator);
                }
                case LoadFileAction.PHANTOMS:
                {
                    FileLoad = new PhantomsFileLoad();
                    return FileLoad.LoadCsvDataIntoSqlServer(path, separator);
                }
                default:
                    {
                        return 0;
                        break;
                    }
            }
        }        
    }
}
